const Vue = require('Vue')


function registerComponents() {
    Vue.component('create-button', require('./src/components/CreateButton').default)
    Vue.component('edit-button', require('./src/components/EditButton').default)
    Vue.component('show-button', require('./src/components/ShowButton').default)
    Vue.component('delete-button', require('./src/components/DeleteButton').default)
    Vue.component('link-button', require('./src/components/LinkButton').default)
    Vue.component('field', require('./src/components/Field').default)
    Vue.component('input-field', require('./src/components/InputField').default)
    Vue.component('image-field', require('./src/components/ImageField').default)
    Vue.component('textarea-field', require('./src/components/TextareaField').default)
    Vue.component('md-editor', require('./src/components/MDEditor').default)
    Vue.component('select-field', require('./src/components/SelectField').default)
    Vue.component('data-table', require('./src/components/DataTable').default)
    Vue.component('tinymce', require('./src/components/TinyMCE').default)
    Vue.component('json-viewer', require('./src/components/JSONViewer').default)
    Vue.component('json-editor', require('./src/components/JSONEditor').default)
    Vue.component('json-modal', require('./src/components/JSONModal').default)
    Vue.component('confirm-button', require('./src/components/ConfirmButton').default)
    Vue.component('taginput', require('./src/components/TagInput').default)
    Vue.component('multiselect', require('./src/components/MultiSelect').default)
}

module.exports = (() => {
    registerComponents()

    return {
        makeRestClient: require('./src/restClient'),
        makeFormMixin: require('./src/mixins/formMixin'),
        makeIndexMixin: require('./src/mixins/indexMixin'),
        makeShowMixin: require('./src/mixins/showMixin'),
    }
})()